/*
 * Copyright 2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.dopdf.document.read;

import org.dopdf.document.model.PageDetail;
import org.dopdf.document.model.ResourceDetail;

import java.io.OutputStream;
import java.io.Serializable;

/**
 * The interface that should be implemented by all sorts of reader that we have in the system.
 *
 * @author Deep Shah
 */
public interface DocumentReader extends Serializable {

    /**
     * The method that will return the number of pages in the pdf document.
     * @return the int value representing the number of pages in the pdf document.
     */
    int getNumberOfPages();

    /**
     * The method that will write the image of the given page to the output stream.
     *
     *
     * @param pageDetail the page detail whose image we need to generate.
     * @return the ResourceDetail reference representing the given page number.
     */
    ResourceDetail getPageAsImage(final PageDetail pageDetail);

    /**
     * Returns the document as a reource to the caller.
     * @return the Document represented as the ReousrceDetail reference.
     */
    ResourceDetail getDocumentAsResource();
}
